<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>::Happy - DTAC Prepaid Phone::</title>
<link href="${RESOURCE}/css/global.css" rel="stylesheet" type="text/css">
<link href="${RESOURCE}/css/global-en.css" rel="stylesheet" type="text/css">
<link href="${RESOURCE}/css/customize.css" rel="stylesheet" type="text/css">
<script src="${RESOURCE}/eng/include/AC_RunActiveContent.js" type="text/javascript"></script>
<script language=JavaScript>

function printWindow(){

browserVersion = parseInt(navigator.appVersion)

if (browserVersion >= 4) window.print()

}



function include(xUrl,xId) {

  var xmlhttp = false;

  /*@cc_on @*/

  /*@if (@_jscript_version >= 5)



  // JScript gives us Conditional compilation, we can cope with old IE versions.

  // and security blocked creation of the objects.

  try {

    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

   } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

   }



  /*@end @*/

  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {

    xmlhttp = new XMLHttpRequest();

  }



  xmlhttp.open("GET", xUrl,true);

  xmlhttp.onreadystatechange=function() {

          if (xmlhttp.readyState==4) {

                document.getElementById(xId).innerHTML = xmlhttp.responseText;

          }

  }

  xmlhttp.send(null)

}







<!--







function MM_preloadImages() { //v3.0



  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();



    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)



    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}



}











// Declaring required variables



var digits = "0123456789";







// non-digit characters which are allowed in phone numbers



var phoneNumberDelimiters = "()- ";







// characters which are allowed in international phone numbers



// (a leading + is OK)



var validWorldPhoneChars = phoneNumberDelimiters + "+";







// Minimum no of digits in an international phone no.



var minDigitsInIPhoneNumber = 10;







function isInteger(s)



{   var i;



    for (i = 0; i < s.length; i++)



    {   



        // Check that current character is number.



        var c = s.charAt(i);



        if (((c < "0") || (c > "9"))) return false;



    }







    // All characters are numbers.



    return true;



}







function stripCharsInBag(s, bag)



{   var i;



    var returnString = "";







    // Search through string's characters one by one.



    // If character is not in bag, append to returnString.



    for (i = 0; i < s.length; i++)



    {   



        // Check that current character isn't whitespace.



        var c = s.charAt(i);



        if (bag.indexOf(c) == -1) returnString += c;



    }







    return returnString;



}







function checkInternationalPhone(strPhone){



	s = stripCharsInBag(strPhone,validWorldPhoneChars);



	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);



}







function ValidateForm(){



	var Phone=document.form1.inputUserName;







	document.form1.submit();



 }







function MM_openBrWindow(theURL,winName,features) { //v2.0



  window.open(theURL,winName,features);



}







function alertChgMobileNumb(){



  var format = /^[0-9]{9}$/;



   



  if(format.test(document.form1.inputUserName.value)) { 



			alert("เธ•เธฑเนเธเนเธ•เนเธงเธฑเธเธ—เธตเน 1 เธเธฑเธเธขเธฒเธขเธ เน€เธเนเธเธ•เนเธเนเธ เธฃเธซเธฑเธชเธเธนเนเนเธเน 9 เธซเธฅเธฑเธ เธเธฐเน€เธเธฅเธตเนเธขเธเน€เธเนเธ 10 เธซเธฅเธฑเธ เนเธ”เธขเนเธชเน 08 เนเธ—เธ 0 เธ•เธฑเธงเธซเธเนเธฒ \nเนเธเธเธฃเธฑเนเธเธ•เนเธญเนเธเธเธฃเธธเธ“เธฒเนเธเนเธฃเธซเธฑเธชเธเธนเนเนเธเน 10 เธซเธฅเธฑเธเนเธเธเธฒเธฃเนเธเนเธเธฃเธดเธเธฒเธฃเธเนเธฒเธเน€เธงเนเธ.");



	}







	document.form1.submit();



}



//-->



</script> 



<script language="JavaScript" type="text/JavaScript">







function gen(){







		var simNumb = document.form1.subr_numb.value;



		if(simNumb.substring(0,1) != "0"){



			alert("Mobile number must start with 0.");



			return;



		}







		if(!isCorrectSim(simNumb)){



			document.form1.subr_numb.focus();



			return ;



		}







		if(simNumb.length == 9){







			alert("From December 1 onwards, username is changed from 9 to 10 digits mobile number with the prefix 08 instead of the prefix 0. \nFor more convenient, your mobile number is treated 10 digits for registration on Web Services from now on.");



			return;



		}











		document.form1.func.value = "getactivatecode";



		document.form1.submit();



	}







function isCorrectSim(sim){ 



		//var f = document.forms[0];    



		var validMobile = /^[0-9]{10}$/;



		var errorMessage = "";  



		if ( !validMobile.test(sim) ) 



			errorMessage += "- Mobile Number must have 10 digit \n and must be in numeric only \n";             



		if ( errorMessage.length > 0 ) {



			alert("Invalid data :\n\n" + errorMessage);



			return false;



		}       



		return true; 



	}



	function isCorrectPassCode(passCode){ 



		//var f = document.forms[0];    



		var validMobile = /^[0-9]{5}$/;



		var errorMessage = "";  



		if ( !validMobile.test(passCode) ) 



			errorMessage += "- Password have 5 digits  \n and must be in numeric only \n";             



		if ( errorMessage.length > 0 ) {



			alert("Invalid data :\n\n" + errorMessage);



			return false;



		}       



		return true;



	}







function check()







{



	var simNumb = document.form1.subr_numb.value;



		if(simNumb.substring(0,1) != "0"){







			alert("Mobile number must start with 0.");



			return;







		}







		if(!isCorrectSim(simNumb)){







			document.form1.subr_numb.focus();



			return ;







		}







		if(emptyField(document.form1.actv_code)){







			alert("Please enter your password");



			document.form1.actv_code.focus();



			return ;







		}







    document.form1.func.value = "register";







    document.form1.submit();







}







function gotoWelcome(){



	window.location = "/bp3/bin/DpromptIndex?lang=E";



}   







function emptyField(textObj)



{



  if (textObj.value.length == 0) return true;



  for (var i=0; i<textObj.value.length; ++i) { 



    var ch = textObj.value.charAt(i);



    if(ch != ' ' && ch != '\t') return false;



  }



  return true;



}



</script>

</head>
<body>
<div id="header">
    <%@include file="../head.jsp" %>
</div>

<div id="container">
	<div id="pathway"><a href="/bp3/bin/DpromptIndex" class="link2">Web Services</a> >Register for Happy Web Service</div>
	<div id="main">
    	<%@ include file="../menu.jsp" %>
    	<div id="content">
        	<div class="content-middle">
                
                <!--เนื้อหาเริ่มที่นี่-->
                <h3><img src="${RESOURCE}/eng/images/14_webservice_head01.gif"></h3>
               	<table width="100%" cellpadding="2" cellspacing="2" height="500">
                  	<tr>
                    	<td valign="top">
						
							<table width="650" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
    
								  <tr> 
								
								
								
									<td height="1" bgcolor="#B4B4B4"></td>
								  </tr>
								
								
								  <tr> 
								
								
								
									<td class="textnormal">&nbsp;</td>
								  </tr>
								
								
								
								  <tr> 
								
								
								
									<td> <table width="100%" border="0" cellspacing="3" cellpadding="0">
								
								
								
										<tr> 
								
								
								
										  <td width="2%"><img src="${RESOURCE}/eng/images/14_webservice_bullet01.gif" width="9" height="9"></td>
								
								
								
										  <td width="98%" class="textnormal_bold"><img src="${RESOURCE}/eng/images/14_webservice_subtitle22.gif" width="350" height="22"></td>
										</tr>
								
								
										<tr> 
								
								
								
										  <td>&nbsp;</td>
								
								
								
										  <td class="textnormal">You can register for Happy Web Services by following 4 easy steps below:<br>
								
								
								
											<br>
								
								
										  <br></td>
										</tr>
								
								
								
										<tr>
								
								
								
										  <td>&nbsp;</td>
								
								
								
										  <td align="center" class="textnormal"><img src="${RESOURCE}/eng/images/14_webservice_register_pic0.gif" width="500" height="100"></td>
										</tr>
								
								
								
									  </table></td>
								  </tr>
								
								
								
								  <tr> 
								
								
								
									<td height="15" align="center"><br>
								
								
								
									<br>
								
								
									<br></td>
								  </tr>
								
								
								
								  <tr> 
								
								
								
									<td height="15" align="left"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
								
								
									  <tr>
								
								
								
										  <td class="textnormal_bold"><img src="${RESOURCE}/eng/images/bullet_grey.gif" width="9" height="9"> 
								
								
								
											Get Password</td>
									  </tr>
								
								
									</table>
								
								
								
									  
								
								
								
									  <table width="100%" border="0" cellspacing="0" cellpadding="0">
								
								
								
										<tr>
								
								
								
										  <td><span class="textgraynormal"></span> 
								
								
								
								
								
								
								
																					  
								
								
								
											</div></td>
										</tr>
									  </table>
								
								
								
									  <table width="100%" border="0" cellspacing="0" cellpadding="0">
								
								
										<tr>
								
								
								
										  <td><form name="form1" id="form1" method="post" action="/bp3/bin/ActivateCodeSSO">
								
								
								
										  <br>
								
								
								
									  <table width="95%" border="0" align="center" cellpadding="2" cellspacing="5">
								
								
								
										<tr> 
								
								
								
										  <td width="45%" height="40" align="right" class="textnormal_bold">your Happy Mobile Number  :</td>
								
								
								
										  <td>   <input type="text" name="subr_numb" autocomplete="off" maxlength="10" value=""    />
								
								
								
										  <br>
								
								
								
										  <font color="#FF0000" class="textredsmall">Mobile phone number 10 digits (08xxxxxxxx)</font></td>
										</tr>
								
								
								
										<tr valign="middle">
								
								
										  <td height="50" align="right" class="textnormal_bold">Click to get password : </td>
								
								
								
										  <td height="50" valign="bottom"><a href="javascript:gen()"><img src="${RESOURCE}/eng/images/14_webservice_password_btn.gif" width="162" height="23" border="0"></a><br>
								
								
								
										  <font color="#FF0000" class="textredsmall">(Wait for the password to be sent to your mobile.<br> 
								
								
								
										  Your password will be valid for 30 minutes.)</font></td>
										</tr>
								
								
								
										<tr>
								
								
								
										  <td height="40" align="right" class="textnormal_bold">Enter your password to access the service:</td>
								
								
										  <td height="40"><input type="password"  maxlength="4" name="actv_code" autocomplete="off" /></td>
										</tr>
									  </table> 
								
								
								
									 
								
								
								
									  <table width="224" border="0" align="center" cellpadding="5" cellspacing="0">
								
								
										<tr align="center" valign="top"> 
								
								
								
												  <td width="105"><a href="javascript:check()"><img src="${RESOURCE}/eng/images/14_webservice_submit.gif" width="58" height="23" border="0"></a></td>
								
								
								
										  <td width="99"><a href="JavaScript:gotoWelcome();"><img src="${RESOURCE}/eng/images/14_webservice_cancel.gif" width="58" height="23" border="0"></a></td>
								
								
								
											<input name="func" type="hidden" value="" />
								
								
								
											<input name="lang" type="hidden" id="lang" value="E" />
										</tr>
									  </table> 
								
								
								
											  <div align="center"><br>
								
								
								
												 
								
								
								
												<table width="60%" border="0" cellspacing="0" cellpadding="0">
								
								
								
												  <tr>
								
								
								
													<td><div align="center" class="textnormal"></div></td>
												  </tr>
												</table>
								
								
								
												
								
								
								
												<br>
											  </div>
								
								
								
											  <p>
											</form></td>
										</tr>
									  </table>
								
								
									  <br>
								
								
								
										<br>
								
								
								
									  </p></td>
								  </tr>
								
								
								
								  <tr> 
								
								
								
									<td height="15" align="left">&nbsp;</td>
								  </tr>
								
								
								
								  <tr> 
								
								
								
									<td height="15" align="center"><br></td>
								  </tr>
								</table>
						
						</td>
                 	</tr>
              	</table>                
                <!--เนื้อหาสิ้นสุดที่นี่-->
                
            </div>
            <div class="content-bottom"></div>
        </div>
    </div>
</div>
<div id="footer">
<img src="${RESOURCE}/eng/images/copy_right.jpg" />
<a href="http://www.dtac.co.th" target="_blank"><img src="${RESOURCE}/eng/images/dtact_logo.jpg" border="0" /></a>
<a href="http://www.happyvirus.com" target="_blank"><img src="${RESOURCE}/eng/images/virus_icon.jpg" border="0" /></a>
</div>
</body>
</html>
